package com.learn.english.mapper;

import com.learn.english.model.entity.TopBanner;
import com.learn.english.model.ro.BannerRo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.*;

/**
 * @author TISNIW
 * @version 1.0
 * @desc
 */
@Mapper
public interface TopBannerMapper {
    @Select("select * from top_banner where status = 1 and type = #{pageId}")
    List<BannerRo> getTopBanner(Integer pageId);
    @Insert("insert into top_banner " +
            "(title,image_url,link_url,sort,start_time,end_time,type) values " +
            "(#{title},#{imageUrl},#{linkUrl},#{sort},#{startTime},#{endTime},#{type})")
    Integer addTopBanner(TopBanner topBanner);
}
